<?php


namespace App\Models;


use Illuminate\Database\Eloquent\Model;

/**
 * Class ProductCustoms
 * @package App\Models
 * @property ProductBook $book
 * @author luffyzhao@vip.126.com
 */
class ProductCustoms extends Model
{
    protected $table = 'product_customs';
    protected $fillable = ['code', 'name', 'unit', 'unit1', 'unit2', 'qy1', 'qy2', 'country', 'net_weight', 'element', 'unique'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function book()
    {
        return $this->hasOne(ProductBook::class, 'unique', 'unique')->orderBy('record_no');
    }
}
